package cz.studio.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import cz.studio.baseDao.AbstractDao;
import cz.studio.entity.Adresa;

public class AdresaDao extends AbstractDao<Adresa, Integer> {

	@SuppressWarnings("unchecked")
	public List<Adresa> findAll() {
		Criteria crit = hs().createCriteria(Adresa.class);
		return crit.list();
	}

	public Adresa find(Integer id) {
		Criteria crit = hs().createCriteria(Adresa.class);
		crit.add(Restrictions.idEq(id));
		return (Adresa) crit.uniqueResult();
	}
}